<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商城</title>


    <script type="text/javascript">
        var Gjsapipara = "";
        //调用微信JS api 支付
        function jsApiCall()
        {

            Gjsapipara = document.getElementById("jsApiParameters").innerText;
            var obj = JSON.parse(Gjsapipara);
            WeixinJSBridge.invoke(
                    'getBrandWCPayRequest',
                    obj,
                    function(res){
//                        WeixinJSBridge.log(res.err_msg);
//                        alert(res.err_code+" "+res.err_desc+" "+res.err_msg);
                        console.log( res.err_code+" "+res.err_desc+" "+res.err_msg );
                    }
            );
        }

        function callpay( )
        {
            Gjsapipara = document.getElementById("jsApiParameters").innerText;
            if( Gjsapipara.length <= 1 )
            {
                setTimeout("callpay()",1000*1);
                return;
            }

            if (typeof WeixinJSBridge == "undefined"){

                if( document.addEventListener ){
                    document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                }else if (document.attachEvent){
                    document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                }
            }else{
                jsApiCall();
            }
        }
    </script>
    <script type="text/javascript">
        //获取共享地址

        window.onload = function(){

            setTimeout("callpay()",1000*1);
        };

    </script>



</head>
<body>
    <span id="jsApiParameters" style="display: none">{$jsApiParameters}</span>
    <!--<span id="jsApiParameters">{$jsApiParameters}</span>-->
    <!--<font color="#9ACD32"><b>234234该笔订单支付金额为<span style="color:#f00;font-size:50px">1分</span>钱</b></font><br/><br/>-->
    <!--<div align="center">-->
        <!--<button style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;" type="button" onclick="callpay('{$jsApiParameters}')" >立即支付</button>-->
        <!--<button style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;" type="button" onclick="callpay()" >立即支付</button>-->
    <!--</div>-->

</body>
</html>